package com.lam.mall.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lam.common.base.controller.BaseController;
import com.lam.common.base.domain.Result;
import com.lam.common.components.dict.annotation.DictAutoTransfer;
import com.lam.framework.annotation.ParamInject;
import com.lam.framework.operLog.annotation.Log;
import com.lam.mall.entity.PayInfo;
import com.lam.mall.param.PayInfoParam;
import com.lam.mall.service.PayInfoService;

/**
 * 订单支付记录Controller
 * 
 * @author admin
 * @date 2023-05-07
 */
@Log(title = "订单支付记录")
@ParamInject
@RestController
@RequestMapping("/${adminPath}/mall/payInfo")
public class PayInfoController extends BaseController {

    @Autowired
    private PayInfoService payInfoService;

    /**
     * 查询订单支付记录列表
     */
    @Log(oper="分页查询")
    @DictAutoTransfer
    @PreAuthorize("@ss.hasPm('mall:payInfo:list')")
    @GetMapping("/list")
    public Result list(PayInfoParam param) {
    
        startPage();
        List<PayInfo> list = payInfoService.selectList(param);
        return Result.ok(getTableData(list));
    }

    /**
     * 获取订单支付记录详细信息
     */
    @DictAutoTransfer
    @Log(oper="根据ID查询")
    @PreAuthorize("@ss.hasPm('mall:payInfo:query')")
    @GetMapping("/{payId}")
    public Result getInfo(@PathVariable("payId") String payId) {
    
        return Result.ok(payInfoService.selectById(payId));
    }

}
